* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background-color: #1a1a1a;
    color: #fff;
    overflow-x: hidden;
    background-image: radial-gradient(circle at 50% 50%, #3a3a3a 0%, #1a1a1a 100%);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.header h1 {
    font-size: 3rem;
    color: #ff6b6b;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 10px;
}

.header p {
    font-size: 1.2rem;
    color: #aaa;
}

.game-stage {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    min-height: 400px;
    position: relative;
    overflow: hidden;
}

.game-stage::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #ff6b6b, #4ecdc4, #ffe66d, #1a535c);
}

.phase-indicator {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 10px 20px;
    background-color: rgba(255, 107, 107, 0.2);
    border: 2px solid #ff6b6b;
    border-radius: 30px;
    font-weight: bold;
    color: #ff6b6b;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

.players-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 80px;
}

.player-card {
    width: 140px;
    height: 200px;
    background: linear-gradient(135deg, #4a4a4a 0%, #2a2a2a 100%);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 2px solid #4a4a4a;
}

.player-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.player-card.active {
    border-color: #4ecdc4;
    box-shadow: 0 0 20px rgba(78, 205, 196, 0.3);
}

/* 玩家行动时的高光效果 */
.player-card.highlight-action {
    border-color: #ffd166;
    box-shadow: 0 0 25px rgba(255, 209, 102, 0.5);
    animation: glow-action 1.5s infinite alternate;
}

@keyframes glow-action {
    from {
        box-shadow: 0 0 25px rgba(255, 209, 102, 0.5);
    }
    to {
        box-shadow: 0 0 35px rgba(255, 209, 102, 0.8);
    }
}

/* 玩家发言时的高光效果 */
.player-card.highlight-speak {
    border-color: #06d6a0;
    box-shadow: 0 0 25px rgba(6, 214, 160, 0.5);
    animation: glow-speak 2s infinite alternate;
}

@keyframes glow-speak {
    from {
        box-shadow: 0 0 25px rgba(6, 214, 160, 0.5);
    }
    to {
        box-shadow: 0 0 35px rgba(6, 214, 160, 0.8);
    }
}

/* 玩家投票时的高光效果 */
.player-card.highlight-vote {
    border-color: #ef476f;
    box-shadow: 0 0 25px rgba(239, 71, 111, 0.5);
    animation: glow-vote 1.5s infinite alternate;
}

@keyframes glow-vote {
    from {
        box-shadow: 0 0 25px rgba(239, 71, 111, 0.5);
    }
    to {
        box-shadow: 0 0 35px rgba(239, 71, 111, 0.8);
    }
}

.player-card.dead {
    opacity: 0.5;
    filter: grayscale(1);
}

.player-card.dead::after {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, transparent 40%, #ff6b6b 40%);
    transform: rotate(45deg);
}

.player-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin: 0 auto 10px;
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.player-name {
    font-size: 1rem;
    margin-bottom: 5px;
    font-weight: bold;
}

.player-status {
    font-size: 0.8rem;
    color: #4ecdc4;
}

/* 玩家身份显示（仅上帝模式可见） */
.player-role {
    font-size: 0.7rem;
    font-weight: bold;
    margin-top: 5px;
    padding: 6px 8px;
    border-radius: 10px;
    background-color: rgba(78, 205, 196, 0.2);
    border: 1px solid #4ecdc4;
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    word-wrap: break-word;
}

/* 玩家卡片设置图标 */
.player-settings {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background-color: rgba(102, 102, 102, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    color: #fff;
    transition: all 0.3s ease;
    z-index: 10;
}

.player-settings:hover {
    background-color: #4ecdc4;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(78, 205, 196, 0.5);
}

/* 玩家卡片信息图标 */
.player-info {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 24px;
    height: 24px;
    background-color: rgba(102, 102, 102, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    color: #fff;
    transition: all 0.3s ease;
    z-index: 10;
}

.player-info:hover {
    background-color: #ff8e53;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(255, 142, 83, 0.5);
}

.action-panel {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
}

.btn {
    padding: 10px 25px;
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #4ecdc4, #45b7aa);
    color: #fff;
}

.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(78, 205, 196, 0.4);
}

.btn-disabled {
    background: #666;
    color: #999;
    cursor: not-allowed;
}

.btn-disabled:hover {
    transform: none;
    box-shadow: none;
}

.chat-container {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    height: 300px;
    display: flex;
    flex-direction: column;
}

.chat-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #444;
}

.chat-header h3 {
    color: #4ecdc4;
    font-size: 1.2rem;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 15px;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #2a2a2a;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #666;
}

.message {
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 15px;
    background-color: rgba(78, 205, 196, 0.1);
    border-left: 3px solid #4ecdc4;
}

.message.whisper {
    background-color: rgba(255, 107, 107, 0.1);
    border-left-color: #ff6b6b;
    font-style: italic;
}

.message .sender {
    font-weight: bold;
    color: #4ecdc4;
    margin-right: 5px;
}

.message.whisper .sender {
    color: #ff6b6b;
}

/* 聊天气泡样式 */
.message-container {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.message.user-message {
    align-self: flex-start;
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px 18px 18px 4px;
    background-color: rgba(78, 205, 196, 0.2);
    border-left: none;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.message.system-message {
    align-self: center;
    max-width: 60%;
    padding: 8px 12px;
    border-radius: 12px;
    background-color: rgba(102, 102, 102, 0.2);
    border-left: none;
    font-style: italic;
    color: #ccc;
}

.player-info-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.player-icon {
    font-size: 1rem;
}

.player-number {
    color: #888;
    font-size: 0.85rem;
}

.player-name {
    font-weight: bold;
    color: #4ecdc4;
}

.player-role-name {
    font-size: 0.85rem;
    color: #ffcc00;
    background-color: rgba(255, 204, 0, 0.1);
    padding: 2px 6px;
    border-radius: 10px;
}

.message-content {
    color: #f0f0f0;
    line-height: 1.4;
}

.timestamp {
    font-size: 0.75rem;
    color: #666;
    float: right;
    margin-top: 5px;
    margin-left: 10px;
}

/* 清除浮动 */
.message::after {
    content: '';
    display: table;
    clear: both;
}

.chat-input {
    display: flex;
    gap: 10px;
}

.chat-input input {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 20px;
    background-color: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 1rem;
}

.chat-input input:focus {
    outline: none;
    background-color: rgba(0, 0, 0, 0.5);
}

.chat-input button {
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    background-color: #4ecdc4;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chat-input button:hover {
    background-color: #45b7aa;
}

.role-info {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #3a3a3a 0%, #2a2a2a 100%);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
    z-index: 1000;
    text-align: center;
    display: none;
}

.role-info.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translate(-50%, -40%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

.role-info h2 {
    font-size: 2rem;
    color: #4ecdc4;
    margin-bottom: 20px;
}

.role-info p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #aaa;
    margin-bottom: 20px;
}

.role-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4ecdc4, #45b7aa);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #fff;
    margin: 0 auto 20px;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 999;
    display: none;
}

.overlay.active {
    display: block;
}

/* 玩家信息弹窗样式 */
.player-info-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border-radius: 15px;
    padding: 30px;
    width: 400px;
    max-width: 90%;
    z-index: 1000;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    display: none;
    border: 2px solid #4ecdc4;
}

.player-info-modal.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

.player-info-modal h2 {
    font-size: 1.8rem;
    color: #4ecdc4;
    margin-bottom: 20px;
    text-align: center;
}

.info-item {
    font-size: 1.1rem;
    color: #aaa;
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #333;
}

.info-item:last-child {
    border-bottom: none;
}

.player-info-modal .btn {
    display: block;
    margin: 20px auto 0;
    background: linear-gradient(135deg, #4ecdc4 0%, #45b7aa 100%);
    color: #fff;
    border: none;
    padding: 10px 20px;
    font-size: 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.player-info-modal .btn:hover {
    background: linear-gradient(135deg, #45b7aa 0%, #3ca79b 100%);
    transform: translateY(-2px);
}

/* 夜间模式样式 */
.night-mode {
    background-color: #0a0a0a;
    background-image: radial-gradient(circle at 50% 50%, #1a1a1a 0%, #0a0a0a 100%);
}

.night-mode .game-stage {
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
}

.night-mode .action-panel {
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
}

.night-mode .chat-container {
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .player-card {
        width: 100px;
        height: 140px;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }
}

.message {
    margin-bottom: 15px;
    padding: 10px 15px;
    border-radius: 10px;
    max-width: 80%;
    word-wrap: break-word;
    animation: fadeIn 0.3s ease;
    position: relative;
}

.user-message {
    background-color: #4a5568;
    color: white;
    margin-left: auto;
}

.ai-message {
    background-color: #e0e0e0;
    color: #333;
    margin-right: auto;
    transition: all 0.2s ease;
}

.message-time {
    font-size: 12px;
    opacity: 0.7;
    margin-top: 5px;
    text-align: right;
}

.ai-message .message-time {
    text-align: left;
}

.chat-input-area {
    padding: 20px;
    background-color: white;
    border-top: 1px solid #ddd;
    display: flex;
    gap: 10px;
}

.chat-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
}

.chat-input:focus {
    border-color: #4a6fa5;
}

.send-message {
    padding: 10px 20px;
    background-color: #4a6fa5;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.send-message:hover {
    background-color: #3a5a85;
}

.send-message:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.system-message {
    text-align: center;
    margin: 10px 0;
    font-size: 12px;
    color: #666;
    font-style: italic;
}
/* 工具调用样式 */
.tool-use {
    background-color: #f0f4f8;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    padding: 10px;
    margin: 8px 0;
    font-family: monospace;
    font-size: 14px;
    color: #2d3748;
    white-space: pre-wrap;
    overflow-x: auto;
    transition: all 0.2s ease;
}

.tool-use:hover {
    background-color: #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.typing-indicator {
    display: flex;
    align-items: center;
    margin-right: auto;
    padding: 10px 15px;
    background-color: #e0e0e0;
    border-radius: 10px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background-color: #666;
    border-radius: 50%;
    margin: 0 2px;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
    animation-delay: 0s;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-5px);
    }
}

/* 滚动条样式 */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 工具调用样式 */
.tool-use {
    background-color: #4a90e2;
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    margin: 8px 0;
    font-family: monospace;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    border-left: 4px solid #2563eb;
}